package com.bjsxt.util;


import com.bjsxt.domain.EntrustOrder;
import com.bjsxt.model.Order;

public class Beanutils {


     public static Order entrustOrder2Order(EntrustOrder entrustOrder) {
        Order order = new Order();
        order.setOrderId(entrustOrder.getId().toString());
        order.setPrice(entrustOrder.getPrice());
        order.setAmount(entrustOrder.getVolume().add(entrustOrder.getDeal().negate()));
        order.setSymbol(entrustOrder.getSymbol());
        order.setOrderDirection(entrustOrder.getType().intValue());
        order.setTime(entrustOrder.getCreated().getTime());

        return order;
    }
}
